package edu.sctu.jarime.may.subway.util;

import edu.sctu.jarime.may.subway.appbean.PeopleAppbean;
import edu.sctu.jarime.may.subway.data.SetStationData;

import java.util.HashMap;


/**
 * Created by user19 on 2015/6/2.
 */
public class SubwayCardDeth {

    private HashMap<String, Integer> map;

    public SubwayCardDeth() {
        map = new SetStationData().setStationData();
    }




    public int conutStationNumber(String start,String end){

               int count=0;
        count=Math.abs(map.get(start)-map.get(end));

        return count;
    }

    public int count_price(String start,String end){
        int price=0;
        int count=this.conutStationNumber(start,end);
        switch (count){
            case 0:price=2;
            case 1:price=2;
            case 2:price=2;
            case 3:price=2;
            case 4:price=4;
            case 5:price=4;
            case 6:price=4;
            case 7:price=5;
            case 8:price=5;
            case 9:price=6;
            case 10:price=6;
            case 11:price=6;
        }
        return price;
    }

    public void buycard(){
        System.out.println("已经出票请在出票口取票");
    }

    public void congzhi(int p,PeopleAppbean peopleAppbean){
        peopleAppbean.setYu_e(p+peopleAppbean.getYu_e());

    }

}
